package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.ShaftspecificationsMapper;
import com.ruoyi.business.domain.Shaftspecifications;
import com.ruoyi.business.service.IShaftspecificationsService;

/**
 * 转子查询Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Service
public class ShaftspecificationsServiceImpl implements IShaftspecificationsService 
{
    @Autowired
    private ShaftspecificationsMapper shaftspecificationsMapper;

    /**
     * 查询转子查询
     * 
     * @param id 转子查询主键
     * @return 转子查询
     */
    @Override
    public Shaftspecifications selectShaftspecificationsById(Long id)
    {
        return shaftspecificationsMapper.selectShaftspecificationsById(id);
    }

    /**
     * 查询转子查询列表
     * 
     * @param shaftspecifications 转子查询
     * @return 转子查询
     */
    @Override
    public List<Shaftspecifications> selectShaftspecificationsList(Shaftspecifications shaftspecifications)
    {
        return shaftspecificationsMapper.selectShaftspecificationsList(shaftspecifications);
    }

    /**
     * 新增转子查询
     * 
     * @param shaftspecifications 转子查询
     * @return 结果
     */
    @Override
    public int insertShaftspecifications(Shaftspecifications shaftspecifications)
    {
        String code = "CODE-" + System.currentTimeMillis();
        shaftspecifications.setCode(code);
        shaftspecifications.setCreateTime(DateUtils.getNowDate());
        return shaftspecificationsMapper.insertShaftspecifications(shaftspecifications);
    }

    /**
     * 修改转子查询
     * 
     * @param shaftspecifications 转子查询
     * @return 结果
     */
    @Override
    public int updateShaftspecifications(Shaftspecifications shaftspecifications)
    {
        shaftspecifications.setUpdateTime(DateUtils.getNowDate());
        return shaftspecificationsMapper.updateShaftspecifications(shaftspecifications);
    }

    /**
     * 批量删除转子查询
     * 
     * @param ids 需要删除的转子查询主键
     * @return 结果
     */
    @Override
    public int deleteShaftspecificationsByIds(Long[] ids)
    {
        return shaftspecificationsMapper.deleteShaftspecificationsByIds(ids);
    }

    /**
     * 删除转子查询信息
     * 
     * @param id 转子查询主键
     * @return 结果
     */
    @Override
    public int deleteShaftspecificationsById(Long id)
    {
        return shaftspecificationsMapper.deleteShaftspecificationsById(id);
    }
}
